data = xlsread('fin_data.xlsx','sheet1');
[m,n] = size(data);
data_sel = data(2:m,4);

max_value = max(data_sel);
min_value = min(data_sel);

c = (max_value - min_value) / 5;
for i = 2:326
    if data(i,4) >= c+min_value && data(i,4) <= c*2+min_value
        data(i,371) = 0;
    else
        if data(i,4) >= c*2+min_value && data(i,4) <= c*3+min_value
            data(i,371) = 1;
        else
            if data(i,4) >= c*3+min_value && data(i,4) <= c*4+min_value
                data(i,371) = 2;
            else
                if data(i,4) >= c*4+min_value && data(i,4) <= max_value
                    data(i,371) = 3;   
                end
            end
        end
    end               
end

xlswrite('1.xlsx',data);


